
#pragma once

#include "BaseDefine.h"

class T;
class Task{
public:
  virtual int run() = 0;  
  
  Task(){}
  
  virtual ~Task(){}
  
protected:
  
private:
};

template < typename T >
class Task_T : public Task{
public:
	virtual int run(){
		t_();
	
		return 0;
	}
      
	Task_T( T t ){
		t_ = t;
    }
      
	virtual ~Task_T(){}
      
protected:
  
private:
    T t_;
};

template < typename F >
Task* make_lambda_task( F task ){
	return new Task_T<F>( task );
}
